package ar.edu.unicen.exa.isistan.archassis.view.classes.classitem.classdata;



import org.eclipse.swt.widgets.Composite;

import ar.edu.unicen.exa.isistan.archassis.ia.seed.VariableSeed;

public class ClassVariableComposite extends ClassDataComposite {

//	private Label varsAttrLabel;
//	private Composite varsAttrComposite;
//	private Button visibilityCheckButton;
//	private Button isStaticCheckButton;
//	private Button isFinalCheckButton;
	
	public ClassVariableComposite(Composite parent) {
		super(parent);
		
//		varsAttrLabel = new Label(this, SWT.NONE);
//		varsAttrLabel.setLayoutData(BorderLayout.SOUTH);
//		varsAttrComposite = new Composite(this, SWT.NONE);
//		varsAttrComposite.setLayoutData(BorderLayout.SOUTH);
//		varsAttrComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
		
//		visibilityCheckButton = new Button(varsAttrComposite, SWT.CHECK);
//		visibilityCheckButton.setText("visibilityCheckButton");
//		
//		isStaticCheckButton = new Button(varsAttrComposite, SWT.CHECK);
//		isStaticCheckButton.setText("isStaticCheckButton");
//		
//		isFinalCheckButton = new Button(varsAttrComposite, SWT.CHECK);
//		isFinalCheckButton.setText("isFinalCheckButton");

		
	}
	
	@Override
	public void setEnabled(boolean enabled) {
		// TODO Auto-generated method stub
		super.setEnabled(enabled);
//		btnExtiendeDe.setEnabled(enabled);
//		System.out.println(value + ":" + enabled);
	}
	
	private VariableSeed javaVariable;
	public void setValue(VariableSeed javaVariable) {
		this.javaVariable = javaVariable;
		String varsAttrText = javaVariable.getVisibility() + " ";
//		this.getVisibilityCheckButton().setText(javaVariable.getVisibility());
		if (javaVariable.isStatic()) {
//			this.getIsStaticCheckButton().setText("static");
			varsAttrText += "static ";
		} else {
//			this.getIsStaticCheckButton().setText("no static");
		}
		if (javaVariable.isFinal()) {
//			this.getIsFinalCheckButton().setText("final");
			varsAttrText += "final ";
		} else {
//			this.getIsFinalCheckButton().setText("no final");
		}

		super.setValue("var", varsAttrText + javaVariable.getType());
//		varsAttrLabel.setText(varsAttrText);
	}
	public VariableSeed getVariable() {
		return javaVariable;
	}

//	protected Button getVisibilityCheckButton() {
//		return visibilityCheckButton;
//	}
//	protected Button getIsStaticCheckButton() {
//		return isStaticCheckButton;
//	}
//	protected Button getIsFinalCheckButton() {
//		return isFinalCheckButton;
//	}
	
}
